<div class="row">

    <div class="col-xs-12">
        <div class="page-header">
            <h1>Loading data - overview</h1>
        </div>

        <p>There are broadly two options for getting data loaded into a table. These are discussed below</p>

        <dl>
            <dt>1. Managed array</dt>
            <dd>
                Hand <code>NgTableParams</code> an in-memory array and let it do the filtering, sorting and paging
                on that array. Eg:<br/>
<pre style="margin-top:10px" data-prettycode pretty-lang="js">
var dataset = [{ name: 'christian', age: 21 }, { name: 'anthony', age: 88 }];
var tp = new NgTableParams({}, { dataset: dataset });
</pre>
            </dd>
            <dt>2. External array</dt>
            <dd>
                Hand <code>NgTableParams</code> a custom <code>getData</code> function that it will call to load
                data. Eg:<br/>
<pre style="margin-top:10px" data-prettycode pretty-lang="js">
var tp = new NgTableParams({}, { getData: function(params){
    /* code to fetch data that matches the params values EG: */
    return executeQuery(params).then(function(data){
        params.total(data.inlineCount);
        return data.results;
    });
}});
</pre>
            </dd>
            <dd>Typically you will use this option to load server-side data</dd>
        </dl>
    </div>
</div>
